package com.edu.controller;

import com.edu.sms.SmsUtil;
import com.edu.sms.SmsUtil2;
import org.springframework.web.bind.annotation.*;

import java.util.concurrent.ExecutionException;

/**
 * @ProjectName: myApp
 * @Titile: SmsController
 * @Author: Administrator
 * @Description: TODO
 */
@RestController
@RequestMapping("/api/sms")
public class SmsController {

    @GetMapping("{phone}")
    public Object sendSms(@PathVariable("phone") String phone) {
        System.out.println("手机号：" + phone);
        try {
            SmsUtil2.sendMsg(phone);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return "发送成功";
    }
}
